<style xmlns:th="http://www.w3.org/1999/xhtml" >
.pdding7{padding-top: 7px;margin-top: 7px;}
</style>
					<form xmlns:th="http://www.w3.org/1999/xhtml" id="form_user_add_1" method="post" action="user/add" class="form-horizontal bv-form" >
							<div class="form-body">
								
								<div class="form-group" >
									<label  class="col-md-3 control-label">用户名（电话）:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text" placeholder="此处不能为空。" name='userName'  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>
								
								<div class="form-group" >
									<label  class="col-md-3 control-label">昵称:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='nickName' placeholder="请输入用户昵称"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group">
									<label  class="col-md-3 control-label">VIP等级:
									</label>
									<div class="col-md-9">
										<select name="vipType" id="vipTypeSelect"  style="width:160px;margin-right:10px;padding: 3px;" >
											<option value="0">--粉丝--</option>
											<option th:each="vip:${vipInfos}"  th:value="${vip.id}" th:text="'--'+${vip.vipName}+'--'"></option>
										</select>
									</div>
								</div>

								<!--10-8-->
								<div class="form-group" style="display: none" id="provinceDiv">
									<label  class="col-md-3 control-label">省份:
									</label>
									<div class="col-md-9 left ">
										<select name="provinceRegionId" id="regionProvince0" >
											<option value="0">--省份--</option>
											<option th:each="pro:${provinces}"  th:value="${pro.regionId}" th:text="'--'+${pro.regionName}+'--'"></option>
										</select>
									</div>
								</div>

								<div class="form-group" id="regionDiv" style="display: none">
									<label  class="col-md-3 control-label">区县:
									</label>
									<div class="col-md-9 left ">
										<select name="provinceRegionId" id="regionProvince1">
											<option value="0">--省份--</option>
											<option th:each="pro:${provinces}"  th:value="${pro.regionId}" th:text="'--'+${pro.regionName}+'--'"></option>
										</select>
										<select name="cityRegionId" id="regionCity1">
											<option value="0">--市--</option>
										</select>
										<select name="countyRegionId" id="regionCounty1">
											<option value="0">--区县--</option>
										</select>
									</div>
								</div>
								
								<div class="form-group" >
									<label  class="col-md-3 control-label">推广人（电话）:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text" placeholder="上级推广人电话，可空。"  name='pusherPhone' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">官方授权码:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text" placeholder="官方授权码，可空"  name='officialServiceNumber'  value=""  />
									</div>
								</div>
						
						</div>
							<div class="  form-group ">
								<div class="pull-right form-btn">
									<button class="btn btn-warning" type="reset"><i class="ace-icon fa fa-undo bigger-110"></i> 重置	</button>
									<button type="submit" class="btn btn-info"><i class="ace-icon fa fa-check bigger-110"></i>确认</button>
								</div>
							</div>
							</form>
<script type="text/javascript">

//^[0-9a-zA-Z]+[0-9a-zA-Z\.-]*\.[a-zA-Z]{2,4}$

jQuery(document).ready(function() {
	
	FormSamples.init({
		formId:'form_user_add_1'
	});

	$("#vipTypeSelect").on("change",function(){
		var value = $(this).val();
		if (value==21){
			$("#provinceDiv").show();
			$("#regionDiv").hide();
		}else if (value==23){
			$("#regionDiv").show();
			$("#provinceDiv").hide();
		}else {
			$("#regionDiv").hide();
			$("#provinceDiv").hide();
		}
	});

	$("#regionProvince1").change(function(){
		var pid = $(this).val();
		$.post("region/cities",{parentId:pid},function(result){
			console.log(result);
			console.log(typeof result);
			var arr = result;
			var len = arr.length;
			var obj = document.getElementById("regionCity1");
			obj.innerHTML="";
			if(len>1){
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value","");
				nullOp.appendChild(document.createTextNode("--市--"));
				obj.appendChild(nullOp);
			}
			$.each(arr, function(index, json){
				//alert(json.channelName);
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value",json.regionId);
				nullOp.appendChild(document.createTextNode(json.regionName));
				obj.appendChild(nullOp);
			});
		});
	});

	$("#regionCity1").change(function(){
		var pid = $(this).val();
		$.post("region/counties",{parentId:pid},function(result){
			console.log(result);
			console.log(typeof result);
			var arr = result;
			var len = arr.length;
			var obj = document.getElementById("regionCounty1");
			obj.innerHTML="";
			if(len>1){
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value","");
				nullOp.appendChild(document.createTextNode("--市--"));
				obj.appendChild(nullOp);
			}
			$.each(arr, function(index, json){
				//alert(json.channelName);
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value",json.regionId);
				nullOp.appendChild(document.createTextNode(json.regionName));
				obj.appendChild(nullOp);
			});
		});
	});
});
</script>